home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / Notes / Using QuickDraw globals.note < prev   
MacBinary  |  1995-01-12  |  4.9 KB  |  [TEXT/ttxt]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Jan 12 01:06:22 1995, modified Thu Jan 12 01:06:22 1995, creator SimpleText, type ASCII, 4354 bytes "Using QuickDraw globals.note" , at 0x1182 332 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID SpeedScript document (C64) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ttxt]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 1c 55 73 69 6e 67 20 | 51 75 69 63 6b 44 72 61 |..Using |QuickDra|
|00000010| 77 20 67 6c 6f 62 61 6c | 73 2e 6e 6f 74 65 00 00 |w global|s.note..|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 74 74 78 | 74 00 00 00 00 00 00 00 |.TEXTttx|t.......|
|00000050| 00 00 00 00 00 11 02 00 | 00 01 4c ab 3a 77 5e ab |........|..L.:w^.|
|00000060| 3a 77 5e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |:w^.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 2f 45 00 00 |........|..../E..|
|00000080| 22 55 73 69 6e 67 20 51 | 75 69 63 6b 44 72 61 77 |"Using Q|uickDraw|
|00000090| 20 67 6c 6f 62 61 6c 73 | 20 69 6e 20 54 48 49 4e | globals| in THIN|
|000000a0| 4b 20 43 2e 20 6e 6f 74 | 65 22 0d 0d 48 49 53 54 |K C. not|e"..HIST|
|000000b0| 4f 52 59 3a 0d 49 27 76 | 65 20 66 6f 72 67 6f 74 |ORY:.I'v|e forgot|
|000000c0| 74 65 6e 20 77 68 6f 20 | 73 65 6e 74 20 6d 65 20 |ten who |sent me |
|000000d0| 74 68 65 20 71 75 65 73 | 74 69 6f 6e 2e 20 49 20 |the ques|tion. I |
|000000e0| 77 6f 72 6b 65 64 20 6f | 75 74 20 74 68 65 20 61 |worked o|ut the a|
|000000f0| 6e 73 77 65 72 20 6f 76 | 65 72 20 61 20 6c 6f 6e |nswer ov|er a lon|
|00000100| 67 20 70 65 72 69 6f 64 | 2c 20 65 76 65 6e 74 75 |g period|, eventu|
|00000110| 61 6c 6c 79 20 67 65 74 | 74 69 6e 67 20 61 20 63 |ally get|ting a c|
|00000120| 6c 61 72 69 66 69 63 61 | 74 69 6f 6e 20 66 72 6f |larifica|tion fro|
|00000130| 6d 20 4d 69 6b 65 20 4b | 61 68 6c 2c 20 74 68 65 |m Mike K|ahl, the|
|00000140| 20 6f 72 69 67 69 6e 61 | 6c 20 61 75 74 68 6f 72 | origina|l author|
|00000150| 20 6f 66 20 54 48 49 4e | 4b 20 43 2e 20 64 67 70 | of THIN|K C. dgp|
|00000160| 2e 0d 0d 51 55 45 53 54 | 49 4f 4e 0d 0d 22 54 68 |...QUEST|ION.."Th|
|00000170| 65 72 65 20 77 61 73 20 | 61 6e 20 65 6c 65 6d 65 |ere was |an eleme|
|00000180| 6e 74 61 72 79 20 71 75 | 65 73 74 69 6f 6e 20 61 |ntary qu|estion a|
|00000190| 62 6f 75 74 20 54 48 49 | 4e 4b 20 43 20 74 68 61 |bout THI|NK C tha|
|000001a0| 74 20 49 20 6d 65 61 6e | 74 20 62 75 74 20 66 6f |t I mean|t but fo|
|000001b0| 72 67 6f 74 20 74 6f 20 | 61 73 6b 20 79 6f 75 2e |rgot to |ask you.|
|000001c0| 20 20 50 61 67 65 20 31 | 36 36 20 6f 66 20 54 48 | Page 1|66 of TH|
|000001d0| 49 4e 4b 20 43 27 73 20 | 27 53 74 61 6e 64 61 72 |INK C's |'Standar|
|000001e0| 64 20 4c 69 62 72 61 72 | 79 20 52 65 66 65 72 65 |d Librar|y Refere|
|000001f0| 6e 63 65 27 20 74 61 6c | 6b 73 20 6f 66 20 67 65 |nce' tal|ks of ge|
|00000200| 6e 65 72 69 63 20 63 6f | 6e 73 6f 6c 65 20 45 6e |neric co|nsole En|
|00000210| 76 69 72 6f 6e 6d 65 6e | 74 20 61 6e 64 20 4d 61 |vironmen|t and Ma|
|00000220| 63 69 6e 74 6f 73 68 20 | 45 6e 76 69 72 6f 6e 6d |cintosh |Environm|
|00000230| 65 6e 74 20 61 6e 64 20 | 73 61 79 73 20 79 6f 75 |ent and |says you|
|00000240| 20 63 61 6e 27 74 20 75 | 73 65 20 75 73 65 20 4d | can't u|se use M|
|00000250| 61 63 20 54 6f 6f 6c 62 | 6f 78 20 69 6e 20 74 68 |ac Toolb|ox in th|
|00000260| 65 20 66 6f 72 6d 65 72 | 2e 20 20 54 68 69 73 20 |e former|. This |
|00000270| 64 6f 65 73 6e 27 74 20 | 73 65 65 6d 20 74 6f 20 |doesn't |seem to |
|00000280| 62 65 20 74 72 75 65 20 | 28 77 65 27 76 65 20 70 |be true |(we've p|
|00000290| 72 6f 67 72 61 6d 6d 65 | 64 20 61 20 6c 6f 74 20 |rogramme|d a lot |
|000002a0| 69 6e 20 62 6f 74 68 20 | 65 6e 76 69 72 6f 6e 6d |in both |environm|
|000002b0| 65 6e 74 73 29 20 62 75 | 74 20 69 74 27 73 20 61 |ents) bu|t it's a|
|000002c0| 6c 77 61 79 73 20 62 6f | 74 68 65 72 65 64 20 6d |lways bo|thered m|
|000002d0| 65 20 74 68 61 74 20 69 | 74 20 6d 61 79 20 63 6f |e that i|t may co|
|000002e0| 6e 74 61 69 6e 20 73 6f | 6d 65 20 74 72 75 74 68 |ntain so|me truth|
|000002f0| 20 73 6f 20 69 74 27 73 | 20 61 20 72 65 63 75 72 | so it's| a recur|
|00000300| 72 65 6e 74 20 63 61 6e | 64 69 64 61 74 65 20 66 |rent can|didate f|
|00000310| 6f 72 20 68 79 70 6f 74 | 68 65 73 65 73 20 61 62 |or hypot|heses ab|
|00000320| 6f 75 74 20 61 6e 79 20 | 70 72 6f 62 6c 65 6d 20 |out any |problem |
|00000330| 74 68 61 74 20 61 72 69 | 73 65 73 2e 20 20 44 6f |that ari|ses. Do|
|00000340| 20 79 6f 75 20 6b 6e 6f | 77 20 65 78 61 63 74 6c | you kno|w exactl|
|00000350| 79 20 77 68 61 74 20 74 | 72 75 74 68 20 69 74 20 |y what t|ruth it |
|00000360| 63 6f 6e 74 61 69 6e 73 | 3f 22 0d 0d 41 4e 53 57 |contains|?"..ANSW|
|00000370| 45 52 0d 0d 54 68 65 20 | 61 6e 73 77 65 72 20 74 |ER..The |answer t|
|00000380| 6f 20 74 68 69 73 20 71 | 75 65 73 74 69 6f 6e 20 |o this q|uestion |
|00000390| 69 73 20 73 6c 69 67 68 | 74 6c 79 20 69 6e 76 6f |is sligh|tly invo|
|000003a0| 6c 76 65 64 2e 20 54 68 | 65 20 66 75 6e 64 61 6d |lved. Th|e fundam|
|000003b0| 65 6e 74 61 6c 20 63 68 | 6f 69 63 65 20 79 6f 75 |ental ch|oice you|
|000003c0| 20 6d 61 6b 65 20 69 73 | 20 77 68 65 74 68 65 72 | make is| whether|
|000003d0| 20 54 48 49 4e 4b 20 43 | 20 77 69 6c 6c 20 69 6e | THINK C| will in|
|000003e0| 69 74 69 61 6c 69 7a 65 | 20 51 75 69 63 6b 44 72 |itialize| QuickDr|
|000003f0| 61 77 20 66 6f 72 20 79 | 6f 75 20 61 6e 64 20 73 |aw for y|ou and s|
|00000400| 75 62 73 65 71 75 65 6e | 74 6c 79 20 70 72 6f 63 |ubsequen|tly proc|
|00000410| 65 73 73 20 61 6c 6c 20 | 6b 65 79 62 6f 61 72 64 |ess all |keyboard|
|00000420| 20 69 6e 70 75 74 20 28 | 76 69 61 20 73 63 61 6e | input (|via scan|
|00000430| 66 2c 20 65 74 63 2e 29 | 20 6f 72 20 77 68 65 74 |f, etc.)| or whet|
|00000440| 68 65 72 20 79 6f 75 20 | 77 69 6c 6c 20 69 6e 69 |her you |will ini|
|00000450| 74 69 61 6c 69 7a 65 20 | 51 75 69 63 6b 44 72 61 |tialize |QuickDra|
|00000460| 77 20 79 6f 75 72 73 65 | 6c 66 20 61 6e 64 20 68 |w yourse|lf and h|
|00000470| 61 6e 64 6c 65 20 61 6c | 6c 20 6b 65 79 62 6f 61 |andle al|l keyboa|
|00000480| 72 64 20 69 6e 70 75 74 | 20 76 69 61 20 47 65 74 |rd input| via Get|
|00000490| 4e 65 78 74 45 76 65 6e | 74 20 28 73 63 61 6e 66 |NextEven|t (scanf|
|000004a0| 20 77 6f 6e 27 74 20 77 | 6f 72 6b 29 2e 20 51 75 | won't w|ork). Qu|
|000004b0| 69 63 6b 64 72 61 77 20 | 69 73 20 69 6e 69 74 69 |ickdraw |is initi|
|000004c0| 61 6c 69 7a 65 64 20 62 | 79 20 61 20 63 61 6c 6c |alized b|y a call|
|000004d0| 20 74 6f 20 49 6e 69 74 | 47 72 61 66 2e 20 41 74 | to Init|Graf. At|
|000004e0| 20 74 68 65 20 74 69 6d | 65 20 6f 66 20 79 6f 75 | the tim|e of you|
|000004f0| 72 20 66 69 72 73 74 20 | 63 61 6c 6c 20 74 6f 20 |r first |call to |
|00000500| 74 68 65 20 63 6f 6e 73 | 6f 6c 65 20 70 61 63 6b |the cons|ole pack|
|00000510| 61 67 65 2c 20 74 79 70 | 69 63 61 6c 6c 79 20 61 |age, typ|ically a|
|00000520| 20 70 72 69 6e 74 66 2c | 20 54 48 49 4e 4b 20 63 | printf,| THINK c|
|00000530| 68 65 63 6b 73 20 74 6f | 20 73 65 65 20 69 66 20 |hecks to| see if |
|00000540| 49 6e 69 74 57 69 6e 64 | 6f 77 20 68 61 73 20 62 |InitWind|ow has b|
|00000550| 65 65 6e 20 63 61 6c 6c | 65 64 2e 20 49 66 20 6e |een call|ed. If n|
|00000560| 6f 74 20 74 68 65 6e 20 | 69 74 20 63 61 6c 6c 73 |ot then |it calls|
|00000570| 20 49 6e 69 74 47 72 61 | 66 2c 20 49 6e 69 74 57 | InitGra|f, InitW|
|00000580| 69 6e 64 6f 77 73 2c 20 | 65 74 63 2e 2c 20 61 6e |indows, |etc., an|
|00000590| 64 20 68 61 6e 64 6c 65 | 73 20 61 6c 6c 20 73 75 |d handle|s all su|
|000005a0| 62 73 65 71 75 65 6e 74 | 20 6b 65 79 62 6f 61 72 |bsequent| keyboar|
|000005b0| 64 20 69 6e 70 75 74 2e | 0d 0d 54 68 61 74 27 73 |d input.|..That's|
|000005c0| 20 74 68 65 20 66 75 6e | 64 61 6d 65 6e 74 61 6c | the fun|damental|
|000005d0| 20 63 68 6f 69 63 65 2e | 20 48 6f 77 65 76 65 72 | choice.| However|
|000005e0| 2c 20 74 68 65 72 65 20 | 61 72 65 20 61 6c 73 6f |, there |are also|
|000005f0| 20 73 6f 6d 65 20 69 6e | 63 69 64 65 6e 74 61 6c | some in|cidental|
|00000600| 20 70 72 6f 62 6c 65 6d | 73 20 74 68 61 74 20 6e | problem|s that n|
|00000610| 65 65 64 6e 27 74 20 62 | 65 2c 20 62 75 74 20 77 |eedn't b|e, but w|
|00000620| 68 69 63 68 20 77 65 20 | 68 61 76 65 20 74 6f 20 |hich we |have to |
|00000630| 6c 69 76 65 20 77 69 74 | 68 2e 20 54 68 65 20 61 |live wit|h. The a|
|00000640| 75 74 68 6f 72 20 6f 66 | 20 54 48 49 4e 4b 20 43 |uthor of| THINK C|
|00000650| 2c 20 4d 69 63 68 61 65 | 6c 20 4b 61 68 6c 2c 20 |, Michae|l Kahl, |
|00000660| 64 65 63 69 64 65 64 20 | 74 68 61 74 20 70 65 6f |decided |that peo|
|00000670| 70 6c 65 20 77 68 6f 20 | 69 6e 63 6c 75 64 65 20 |ple who |include |
|00000680| 41 4e 53 49 20 69 6e 20 | 74 68 65 69 72 20 70 72 |ANSI in |their pr|
|00000690| 6f 6a 65 63 74 73 20 73 | 68 6f 75 6c 64 6e 27 74 |ojects s|houldn't|
|000006a0| 20 61 6c 73 6f 20 68 61 | 76 65 20 74 6f 20 69 6e | also ha|ve to in|
|000006b0| 63 6c 75 64 65 20 4d 61 | 63 54 72 61 70 73 2e 20 |clude Ma|cTraps. |
|000006c0| 55 6e 66 6f 72 74 75 6e | 61 74 65 6c 79 20 68 69 |Unfortun|ately hi|
|000006d0| 73 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |s implem|entation|
|000006e0| 20 6f 66 20 74 68 61 74 | 20 72 65 73 75 6c 74 73 | of that| results|
|000006f0| 20 69 6e 20 64 75 70 6c | 69 63 61 74 69 6e 67 20 | in dupl|icating |
|00000700| 74 68 65 20 51 75 69 63 | 6b 44 72 61 77 20 67 6c |the Quic|kDraw gl|
|00000710| 6f 62 61 6c 20 61 72 65 | 61 2e 20 53 6f 20 6d 6f |obal are|a. So mo|
|00000720| 73 74 20 6f 66 20 74 68 | 65 20 51 75 69 63 6b 44 |st of th|e QuickD|
|00000730| 72 61 77 20 67 6c 6f 62 | 61 6c 73 2c 20 65 2e 67 |raw glob|als, e.g|
|00000740| 2e 20 74 68 65 20 63 6f | 6c 6f 72 20 22 67 72 61 |. the co|lor "gra|
|00000750| 79 22 2c 20 70 6f 69 6e | 74 20 74 6f 20 74 68 65 |y", poin|t to the|
|00000760| 20 77 72 6f 6e 67 20 67 | 6c 6f 62 61 6c 20 61 72 | wrong g|lobal ar|
|00000770| 65 61 2c 20 61 6e 64 20 | 61 72 65 20 75 73 65 6c |ea, and |are usel|
|00000780| 65 73 73 2e 0d 0d 48 65 | 72 65 27 73 20 61 20 63 |ess...He|re's a c|
|00000790| 6f 70 79 20 6f 66 20 61 | 20 22 62 75 67 22 20 72 |opy of a| "bug" r|
|000007a0| 65 70 6f 72 74 20 74 68 | 61 74 20 49 20 73 65 6e |eport th|at I sen|
|000007b0| 74 20 74 6f 20 4d 69 6b | 65 20 4b 61 68 6c 2c 20 |t to Mik|e Kahl, |
|000007c0| 0d 0d 22 54 68 69 73 20 | 69 73 20 61 20 62 75 67 |.."This |is a bug|
|000007d0| 2e 20 41 73 20 66 61 72 | 20 61 73 20 49 20 63 61 |. As far| as I ca|
|000007e0| 6e 20 74 65 6c 6c 20 74 | 68 65 20 71 75 69 63 6b |n tell t|he quick|
|000007f0| 64 72 61 77 20 50 61 74 | 74 65 72 6e 73 20 62 6c |draw Pat|terns bl|
|00000800| 61 63 6b 2c 20 77 68 69 | 74 65 2c 20 61 6e 64 20 |ack, whi|te, and |
|00000810| 67 72 61 79 20 61 72 65 | 20 61 6c 6c 20 7a 65 72 |gray are| all zer|
|00000820| 6f 20 28 69 2e 65 2e 20 | 65 71 75 69 76 61 6c 65 |o (i.e. |equivale|
|00000830| 6e 74 20 74 6f 20 77 68 | 69 74 65 29 2e 22 0d 0d |nt to wh|ite)."..|
|00000840| 61 6e 64 20 68 69 73 20 | 72 65 70 6c 79 2c 0d 0d |and his |reply,..|
|00000850| 22 41 73 20 66 61 72 20 | 61 73 20 79 6f 75 72 20 |"As far |as your |
|00000860| 72 65 70 6f 72 74 65 64 | 20 62 75 67 20 67 6f 65 |reported| bug goe|
|00000870| 73 2c 20 49 20 73 75 73 | 70 65 63 74 20 74 68 65 |s, I sus|pect the|
|00000880| 20 6d 69 73 74 61 6b 65 | 20 69 73 20 79 6f 75 72 | mistake| is your|
|00000890| 73 2e 20 20 49 27 6d 20 | 67 75 65 73 73 69 6e 67 |s. I'm |guessing|
|000008a0| 20 79 6f 75 27 72 65 20 | 72 75 6e 6e 69 6e 67 20 | you're |running |
|000008b0| 69 6e 74 6f 20 74 68 69 | 73 20 70 72 6f 62 6c 65 |into thi|s proble|
|000008c0| 6d 20 28 51 44 20 70 61 | 74 74 65 72 6e 73 20 62 |m (QD pa|tterns b|
|000008d0| 65 69 6e 67 20 77 72 6f | 6e 67 29 20 69 6e 20 61 |eing wro|ng) in a|
|000008e0| 20 63 6f 6e 74 65 78 74 | 20 69 6e 20 77 68 69 63 | context| in whic|
|000008f0| 68 20 79 6f 75 20 68 61 | 76 65 20 6e 6f 74 20 63 |h you ha|ve not c|
|00000900| 61 6c 6c 65 64 20 49 6e | 69 74 47 72 61 66 2e 20 |alled In|itGraf. |
|00000910| 20 52 65 6d 65 6d 62 65 | 72 2c 20 74 68 65 20 22 | Remembe|r, the "|
|00000920| 51 75 69 63 6b 44 72 61 | 77 20 67 6c 6f 62 61 6c |QuickDra|w global|
|00000930| 73 22 20 61 72 65 20 6a | 75 73 74 20 76 61 72 69 |s" are j|ust vari|
|00000940| 61 62 6c 65 73 20 69 6e | 20 79 6f 75 72 20 6f 77 |ables in| your ow|
|00000950| 6e 20 67 6c 6f 62 61 6c | 20 73 70 61 63 65 3b 20 |n global| space; |
|00000960| 74 68 65 79 20 67 65 74 | 20 66 69 6c 6c 65 64 20 |they get| filled |
|00000970| 69 6e 20 62 79 20 49 6e | 69 74 47 72 61 66 2c 20 |in by In|itGraf, |
|00000980| 77 68 69 63 68 20 69 73 | 20 77 68 79 20 49 6e 69 |which is| why Ini|
|00000990| 74 47 72 61 66 20 74 61 | 6b 65 73 20 26 74 68 65 |tGraf ta|kes &the|
|000009a0| 50 6f 72 74 20 61 73 20 | 61 6e 20 61 72 67 75 6d |Port as |an argum|
|000009b0| 65 6e 74 2e 20 20 53 6f | 20 69 6e 20 61 20 6e 6f |ent. So| in a no|
|000009c0| 6e 2d 61 70 70 6c 69 63 | 61 74 69 6f 6e 2c 20 6f |n-applic|ation, o|
|000009d0| 72 20 69 6e 20 61 6e 20 | 61 70 70 6c 69 63 61 74 |r in an |applicat|
|000009e0| 69 6f 6e 20 72 75 6e 6e | 69 6e 67 20 75 6e 64 65 |ion runn|ing unde|
|000009f0| 72 20 74 68 65 20 22 63 | 6f 6e 73 6f 6c 65 20 65 |r the "c|onsole e|
|00000a00| 6e 76 69 72 6f 6e 6d 65 | 6e 74 22 2c 20 74 68 65 |nvironme|nt", the|
|00000a10| 20 51 75 69 63 6b 44 72 | 61 77 20 67 6c 6f 62 61 | QuickDr|aw globa|
|00000a20| 6c 73 20 64 6f 6e 27 74 | 20 67 65 74 20 69 6e 69 |ls don't| get ini|
|00000a30| 74 69 61 6c 69 7a 65 64 | 2e 0d 0d 22 54 68 65 20 |tialized|..."The |
|00000a40| 63 6f 6e 73 6f 6c 65 20 | 63 6f 64 65 20 28 69 6e |console |code (in|
|00000a50| 20 22 63 6f 6e 73 6f 6c | 65 2e 63 22 29 20 63 61 | "consol|e.c") ca|
|00000a60| 6c 6c 73 20 49 6e 69 74 | 47 72 61 66 20 61 6e 64 |lls Init|Graf and|
|00000a70| 20 74 68 65 20 6f 74 68 | 65 72 20 4d 61 63 20 69 | the oth|er Mac i|
|00000a80| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 20 63 61 |nitializ|ation ca|
|00000a90| 6c 6c 73 2c 20 73 6f 20 | 79 6f 75 20 77 6f 6e 27 |lls, so |you won'|
|00000aa0| 74 20 68 61 76 65 20 74 | 6f 2e 20 20 52 65 6d 65 |t have t|o. Reme|
|00000ab0| 6d 62 65 72 2c 20 74 68 | 65 20 63 6f 6e 73 6f 6c |mber, th|e consol|
|00000ac0| 65 20 73 74 75 66 66 20 | 69 73 20 64 65 73 69 67 |e stuff |is desig|
|00000ad0| 6e 65 64 20 74 6f 20 61 | 6c 6c 6f 77 20 79 6f 75 |ned to a|llow you|
|00000ae0| 20 74 6f 20 72 75 6e 20 | 76 61 6e 69 6c 6c 61 20 | to run |vanilla |
|00000af0| 73 74 64 69 6f 2d 62 61 | 73 65 64 20 43 20 63 6f |stdio-ba|sed C co|
|00000b00| 64 65 20 77 69 74 68 6f | 75 74 20 6d 6f 64 69 66 |de witho|ut modif|
|00000b10| 69 63 61 74 69 6f 6e 2e | 20 49 20 6d 61 64 65 20 |ication.| I made |
|00000b20| 61 20 64 65 63 69 73 69 | 6f 6e 20 65 61 72 6c 79 |a decisi|on early|
|00000b30| 20 6f 6e 20 74 68 61 74 | 20 74 68 65 20 41 4e 53 | on that| the ANS|
|00000b40| 49 20 6c 69 62 72 61 72 | 79 20 28 77 68 69 63 68 |I librar|y (which|
|00000b50| 20 69 73 20 77 68 65 72 | 65 20 74 68 65 20 63 6f | is wher|e the co|
|00000b60| 6e 73 6f 6c 65 20 73 74 | 75 66 66 20 6c 69 76 65 |nsole st|uff live|
|00000b70| 73 29 20 77 6f 75 6c 64 | 20 6e 6f 74 20 6d 61 6b |s) would| not mak|
|00000b80| 65 20 61 6e 79 20 72 65 | 66 65 72 65 6e 63 65 20 |e any re|ference |
|00000b90| 74 6f 20 4d 61 63 54 72 | 61 70 73 2e 20 20 49 6e |to MacTr|aps. In|
|00000ba0| 20 74 68 65 20 70 61 73 | 74 2c 20 75 73 65 72 73 | the pas|t, users|
|00000bb0| 20 68 61 76 65 20 62 65 | 65 6e 20 63 6f 6e 66 75 | have be|en confu|
|00000bc0| 73 65 64 20 61 62 6f 75 | 74 20 68 61 76 69 6e 67 |sed abou|t having|
|00000bd0| 20 74 6f 20 6c 6f 61 64 | 20 4d 61 63 54 72 61 70 | to load| MacTrap|
|00000be0| 73 20 61 73 20 77 65 6c | 6c 20 61 73 20 73 74 64 |s as wel|l as std|
|00000bf0| 69 6f 2c 20 73 6f 20 49 | 20 77 61 6e 74 65 64 20 |io, so I| wanted |
|00000c00| 74 6f 20 6d 61 6b 65 20 | 74 68 65 20 41 4e 53 49 |to make |the ANSI|
|00000c10| 20 6c 69 62 72 61 72 79 | 20 63 6f 6d 70 6c 65 74 | library| complet|
|00000c20| 65 6c 79 20 73 65 6c 66 | 2d 63 6f 6e 74 61 69 6e |ely self|-contain|
|00000c30| 65 64 2e 20 20 53 6f 20 | 74 68 72 6f 75 67 68 6f |ed. So |througho|
|00000c40| 75 74 20 41 4e 53 49 2c | 20 69 66 20 49 20 6e 65 |ut ANSI,| if I ne|
|00000c50| 65 64 65 64 20 74 6f 20 | 69 73 73 75 65 20 61 20 |eded to |issue a |
|00000c60| 63 61 6c 6c 20 74 68 61 | 74 27 73 20 6e 6f 72 6d |call tha|t's norm|
|00000c70| 61 6c 6c 79 20 64 6f 6e | 65 20 74 68 72 6f 75 67 |ally don|e throug|
|00000c80| 68 20 67 6c 75 65 20 69 | 6e 20 4d 61 63 54 72 61 |h glue i|n MacTra|
|00000c90| 70 73 2c 20 49 20 63 61 | 6c 6c 65 64 20 69 74 20 |ps, I ca|lled it |
|00000ca0| 64 69 72 65 63 74 6c 79 | 20 75 73 69 6e 67 20 69 |directly| using i|
|00000cb0| 6e 6c 69 6e 65 20 61 73 | 73 65 6d 62 6c 79 20 69 |nline as|sembly i|
|00000cc0| 6e 73 74 65 61 64 2e 20 | 20 53 69 6d 69 6c 61 72 |nstead. | Similar|
|00000cd0| 6c 79 2c 20 77 68 65 6e | 20 49 20 68 61 64 20 74 |ly, when| I had t|
|00000ce0| 6f 20 70 61 73 73 20 74 | 68 65 20 61 64 64 72 65 |o pass t|he addre|
|00000cf0| 73 73 20 6f 66 20 73 6f | 6d 65 20 51 75 69 63 6b |ss of so|me Quick|
|00000d00| 44 72 61 77 20 67 6c 6f | 62 61 6c 73 20 74 6f 20 |Draw glo|bals to |
|00000d10| 49 6e 69 74 47 72 61 66 | 20 77 68 65 6e 20 64 6f |InitGraf| when do|
|00000d20| 69 6e 67 20 74 68 65 20 | 63 6f 6e 73 6f 6c 65 20 |ing the |console |
|00000d30| 73 74 75 66 66 2c 20 49 | 20 70 61 73 73 65 64 20 |stuff, I| passed |
|00000d40| 61 6e 20 61 64 64 72 65 | 73 73 20 70 72 69 76 61 |an addre|ss priva|
|00000d50| 74 65 20 74 6f 20 22 63 | 6f 6e 73 6f 6c 65 2e 63 |te to "c|onsole.c|
|00000d60| 22 2c 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 64 |", rathe|r than d|
|00000d70| 72 61 67 20 69 6e 20 4d | 61 63 54 72 61 70 73 20 |rag in M|acTraps |
|00000d80| 28 77 68 69 63 68 20 69 | 73 20 77 68 65 72 65 20 |(which i|s where |
|00000d90| 22 74 68 65 50 6f 72 74 | 22 2c 20 22 67 72 61 79 |"thePort|", "gray|
|00000da0| 22 2c 20 65 74 63 2e 2c | 20 6c 69 76 65 29 2e 0d |", etc.,| live)..|
|00000db0| 0d 22 49 66 20 79 6f 75 | 20 63 61 6c 6c 20 49 6e |."If you| call In|
|00000dc0| 69 74 47 72 61 66 20 79 | 6f 75 72 73 65 6c 66 2c |itGraf y|ourself,|
|00000dd0| 20 74 68 65 20 63 6f 6e | 73 6f 6c 65 20 77 69 6c | the con|sole wil|
|00000de0| 6c 20 73 74 69 6c 6c 20 | 64 6f 20 6f 6e 65 2e 20 |l still |do one. |
|00000df0| 20 49 27 6d 20 6e 6f 74 | 20 73 75 72 65 20 77 68 | I'm not| sure wh|
|00000e00| 61 74 20 68 61 70 70 65 | 6e 73 20 69 66 20 49 6e |at happe|ns if In|
|00000e10| 69 74 47 72 61 66 20 67 | 65 74 73 20 63 61 6c 6c |itGraf g|ets call|
|00000e20| 65 64 20 74 77 69 63 65 | 2c 20 62 75 74 20 6d 79 |ed twice|, but my|
|00000e30| 20 67 75 65 73 73 20 77 | 6f 75 6c 64 20 62 65 20 | guess w|ould be |
|00000e40| 74 68 61 74 20 74 68 65 | 20 73 65 63 6f 6e 64 20 |that the| second |
|00000e50| 63 61 6c 6c 20 77 6f 75 | 6c 64 20 6f 76 65 72 72 |call wou|ld overr|
|00000e60| 69 64 65 20 74 68 65 20 | 66 69 72 73 74 2c 20 6d |ide the |first, m|
|00000e70| 61 6b 69 6e 67 20 74 68 | 65 20 66 69 72 73 74 20 |aking th|e first |
|00000e80| 63 61 6c 6c 27 73 20 51 | 75 69 63 6b 44 72 61 77 |call's Q|uickDraw|
|00000e90| 20 67 6c 6f 62 61 6c 73 | 20 6e 6f 20 6c 6f 6e 67 | globals| no long|
|00000ea0| 65 72 20 62 65 20 54 48 | 45 20 51 75 69 63 6b 44 |er be TH|E QuickD|
|00000eb0| 72 61 77 20 67 6c 6f 62 | 61 6c 73 2e 20 20 53 74 |raw glob|als. St|
|00000ec0| 69 6c 6c 2c 20 69 66 20 | 61 6c 6c 20 79 6f 75 20 |ill, if |all you |
|00000ed0| 63 61 72 65 20 61 62 6f | 75 74 20 69 73 20 67 65 |care abo|ut is ge|
|00000ee0| 74 74 69 6e 67 20 74 68 | 65 20 70 61 74 74 65 72 |tting th|e patter|
|00000ef0| 6e 73 20 69 6e 69 74 69 | 61 6c 69 7a 65 64 2c 20 |ns initi|alized, |
|00000f00| 69 74 20 6d 69 67 68 74 | 20 77 6f 72 6b 2e 20 20 |it might| work. |
|00000f10| 59 6f 75 20 6d 69 67 68 | 74 20 74 72 79 20 69 74 |You migh|t try it|
|00000f20| 2c 20 62 75 74 20 49 27 | 64 20 66 65 65 6c 20 73 |, but I'|d feel s|
|00000f30| 61 66 65 72 20 63 6f 70 | 79 69 6e 67 20 74 68 65 |afer cop|ying the|
|00000f40| 20 63 6f 6e 73 6f 6c 65 | 27 73 20 51 75 69 63 6b | console|'s Quick|
|00000f50| 44 72 61 77 20 67 6c 6f | 62 61 6c 73 20 69 6e 74 |Draw glo|bals int|
|00000f60| 6f 20 79 6f 75 72 73 2c | 20 65 2e 67 2e 0d 0d 20 |o yours,| e.g... |
|00000f70| 20 20 20 61 73 6d 20 7b | 0d 20 20 20 20 20 20 20 | asm {|. |
|00000f80| 20 6d 6f 76 65 61 2e 6c | 20 28 61 35 29 2c 61 30 | movea.l| (a5),a0|
|00000f90| 0d 20 20 20 20 20 20 20 | 20 6d 6f 76 65 2e 6c 20 |. | move.l |
|00000fa0| 20 2d 32 34 28 61 30 29 | 2c 67 72 61 79 0d 20 20 | -24(a0)|,gray. |
|00000fb0| 20 20 20 20 20 20 6d 6f | 76 65 2e 6c 20 20 2d 32 | mo|ve.l -2|
|00000fc0| 30 28 61 30 29 2c 67 72 | 61 79 2b 34 0d 20 20 20 |0(a0),gr|ay+4. |
|00000fd0| 20 7d 0d 0d 22 49 66 20 | 79 6f 75 20 67 65 74 20 | }.."If |you get |
|00000fe0| 61 73 20 66 61 72 20 69 | 6e 20 79 6f 75 72 20 6f |as far i|n your o|
|00000ff0| 77 6e 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |wn initi|alizatio|
|00001000| 6e 73 20 61 73 20 49 6e | 69 74 57 69 6e 64 6f 77 |ns as In|itWindow|
|00001010| 2c 20 74 68 65 20 63 6f | 6e 73 6f 6c 65 20 77 6f |, the co|nsole wo|
|00001020| 6e 27 74 20 64 6f 20 61 | 6e 79 20 6f 66 20 69 74 |n't do a|ny of it|
|00001030| 73 20 6f 77 6e 20 69 6e | 69 74 69 61 6c 69 7a 61 |s own in|itializa|
|00001040| 74 69 6f 6e 73 2c 20 62 | 75 74 20 74 68 65 6e 20 |tions, b|ut then |
|00001050| 79 6f 75 27 72 65 20 72 | 65 73 70 6f 6e 73 69 62 |you're r|esponsib|
|00001060| 6c 65 20 66 6f 72 20 74 | 68 65 20 77 68 6f 6c 65 |le for t|he whole|
|00001070| 20 65 76 65 6e 74 20 6c | 6f 6f 70 2c 20 65 74 63 | event l|oop, etc|
|00001080| 2e 20 20 41 6c 73 6f 20 | 69 6e 20 74 68 69 73 20 |. Also |in this |
|00001090| 6d 6f 64 65 20 74 68 65 | 20 63 6f 6e 73 6f 6c 65 |mode the| console|
|000010a0| 73 20 61 72 65 20 77 72 | 69 74 65 2d 6f 6e 6c 79 |s are wr|ite-only|
|000010b0| 2e 20 20 54 68 69 73 20 | 66 65 61 74 75 72 65 20 |. This |feature |
|000010c0| 69 73 20 74 68 65 72 65 | 20 73 6f 20 79 6f 75 20 |is there| so you |
|000010d0| 63 61 6e 20 68 61 76 65 | 20 61 20 22 70 72 69 6e |can have| a "prin|
|000010e0| 74 66 20 77 69 6e 64 6f | 77 22 20 69 6e 20 79 6f |tf windo|w" in yo|
|000010f0| 75 72 20 6f 74 68 65 72 | 77 69 73 65 20 4d 61 63 |ur other|wise Mac|
|00001100| 2d 73 74 79 6c 65 20 61 | 70 70 6c 69 63 61 74 69 |-style a|pplicati|
|00001110| 6f 6e 2e 22 0d 0d 53 4f | 4c 55 54 49 4f 4e 0d 0d |on."..SO|LUTION..|
|00001120| 55 73 65 20 74 68 65 20 | 6e 65 77 20 56 69 64 65 |Use the |new Vide|
|00001130| 6f 54 6f 6f 6c 62 6f 78 | 20 72 6f 75 74 69 6e 65 |oToolbox| routine|
|00001140| 73 20 43 6f 70 79 51 75 | 69 63 6b 44 72 61 77 47 |s CopyQu|ickDrawG|
|00001150| 6c 6f 62 61 6c 73 28 29 | 2c 20 77 68 69 63 68 20 |lobals()|, which |
|00001160| 69 6d 70 6c 65 6d 65 6e | 74 73 20 4d 69 6b 65 20 |implemen|ts Mike |
|00001170| 4b 61 68 6c 27 73 20 73 | 75 67 67 65 73 74 69 6f |Kahl's s|uggestio|
|00001180| 6e 2e 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.......|........|
|00001190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 00 00 01 00 00 00 01 1a | 00 00 00 1a 00 00 00 32 |........|.......2|
|00001210| 00 0c 00 03 00 00 00 00 | 00 00 00 00 00 00 54 45 |........|......TE|
|00001220| 58 54 00 00 02 83 54 68 | 65 20 50 6f 77 65 72 20 |XT....Th|e Power |
|00001230| 1c 55 73 69 6e 67 20 51 | 75 69 63 6b 44 72 61 77 |.Using Q|uickDraw|
|00001240| 20 67 6c 6f 62 61 6c 73 | 2e 6e 6f 74 65 77 02 00 | globals|.notew..|
|00001250| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 ab bf ee 3e 00 00 | 00 00 00 00 01 4c 30 30 |.....>..|.....L00|
|00001280| 2c 20 61 6e 64 20 69 74 | 73 20 74 77 6f 20 62 75 |, and it|s two bu|
|00001290| 69 6c 74 2d 69 6e 20 76 | 69 64 65 6f 20 70 6f 72 |ilt-in v|ideo por|
|000012a0| 74 73 20 61 72 65 20 76 | 65 72 79 20 66 61 73 74 |ts are v|ery fast|
|000012b0| 3b 20 61 73 20 66 61 73 | 74 20 61 73 20 74 68 65 |; as fas|t as the|
|000012c0| 20 66 61 73 74 65 73 74 | 20 51 75 61 64 72 61 2e | fastest| Quadra.|
|000012d0| 20 57 65 20 64 6f 6e 27 | 74 20 6e 65 65 64 20 61 | We don'|t need a|
|000012e0| 6e 79 20 73 6c 6f 74 73 | 2e 20 49 66 20 79 6f 75 |ny slots|. If you|
|000012f0| 20 77 61 6e 74 20 73 6c | 6f 74 73 2c 20 79 6f 75 | want sl|ots, you|
|00001300| 00 00 00 16 00 01 00 00 | 00 00 00 10 00 0c 00 01 |........|........|
|00001310| 00 00 00 00 00 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|00001320| 01 1a 00 00 00 1a 00 00 | 00 32 00 eb 6c f4 1c 48 |........|.2..l..H|
|00001330| 00 00 00 1c 00 32 00 00 | 73 74 79 6c 00 00 00 0a |.....2..|styl....|
|00001340| 00 80 ff ff 00 00 00 00 | 00 eb c8 40 00 00 00 00 |........|...@....|
|00001350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+